import {createApp} from 'vue'
import App from './App.vue'
import router from './routers'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import {store, key} from './store';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCN from 'element-plus/es/locale/lang/zh-cn'
import '/@/theme/app.scss';
import '/@/theme/index.scss';
// @ts-ignore
import VueGridLayout from 'vue-grid-layout';
// import * as DataV from '@dataview/datav-vue3'
import { createPinia } from "pinia";
import 'virtual:svg-icons-register'

const pinia = createPinia();
const app = createApp(App);
// @ts-ignore
app
    .use(store, key)
    .use(ElementPlus, {locale: zhCN, size: 'small'})
    .use(router)
    .use(pinia)
    .use(VueGridLayout)
    // .use(DataV as any, {classNamePrefix: 'dv-'})
    .mount('#app'
    )

//全局注册图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

await router.isReady();